package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.jsola.hr.dto.SaleRebatesRulesAddDTO;
import org.jsola.hr.dto.SaleRebatesRulesUpdateDTO;
import org.jsola.hr.entity.SaleRebatesRulesDO;
import org.jsola.hr.query.SaleRebatesRulesQuery;
import org.jsola.hr.vo.SaleRebatesRulesListVO;
import org.jsola.hr.vo.SaleRebatesRulesVO;

import java.util.List;

/**
 * 返费规则
 *
 * @author zhr
 */
@Api(tags = "hr-返费规则")
public interface ISaleRebatesRulesControllerAPI {

    /**
     * 新增返费规则
     *
     * @param saleRebatesRulesAddDTO 返费规则新增实体
     * @return 返费规则展示对象
     */
    @ApiOperation(value = "新增返费规则")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "saleRebatesRulesAddDTO", dataType = "SaleRebatesRulesAddDTO", value = "新增返费规则", paramType = "body")
    })
    Result<SaleRebatesRulesVO> save(SaleRebatesRulesAddDTO saleRebatesRulesAddDTO);


    /**
     * 修改返费规则
     *
     * @param saleRebatesRulesUpdateDTO 返费规则
     * @return 更新数量
     */
    @ApiOperation(value = "修改返费规则")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "saleRebatesRulesUpdateDTO", dataType = "SaleRebatesRulesUpdateDTO", value = "修改返费规则", paramType = "body")
    })
    Result<Integer> update(SaleRebatesRulesUpdateDTO saleRebatesRulesUpdateDTO);


    /**
     * 删除单个返费规则，彻底删除
     *
     * @param saleRebatesRulesId 返费规则id
     * @return 删除数量
     */
    @ApiOperation(value = "删除单个返费规则，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "saleRebatesRulesId", dataType = "String", value = "返费规则id", paramType = "path")
    })
    Result<Integer> delete(String saleRebatesRulesId);


    /**
     * 批量删除返费规则，彻底删除
     *
     * @param saleRebatesRulesIds 返费规则id集合
     * @return 删除数量
     */
    @ApiOperation(value = "批量删除返费规则，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "saleRebatesRulesIds", dataType = "String[]", value = "返费规则id数组", paramType = "body", allowMultiple = true)
    })
    Result<Integer> deleteBatch(String[] saleRebatesRulesIds);


    /**
     * 根据返费规则id查询返费规则详情
     *
     * @param saleRebatesRulesId 返费规则id
     * @return 返费规则详情
     */
    @ApiOperation(value = "根据返费规则id查询返费规则详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "saleRebatesRulesId", dataType = "String", value = "返费规则id", paramType = "path")
    })
    Result<SaleRebatesRulesVO> findById(String saleRebatesRulesId);


    /**
     * 查询返费规则
     *
     * @param saleRebatesRulesQuery 返费规则查询参数
     * @return page
     */
    @ApiOperation(value = "查询返费规则")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "saleRebatesRulesQuery", dataType = "SaleRebatesRulesQuery", value = "返费规则查询参数", paramType = "query")
    })
    Result<List<SaleRebatesRulesListVO>> listAll(SaleRebatesRulesQuery saleRebatesRulesQuery);


    /**
     * 分页查询返费规则
     *
     * @param saleRebatesRulesQuery 返费规则查询参数
     * @return page
     */
    @ApiOperation(value = "分页查询返费规则")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "saleRebatesRulesQuery", dataType = "SaleRebatesRulesQuery", value = "返费规则查询参数", paramType = "query")
    })
    Result<Page<SaleRebatesRulesListVO>> page(SaleRebatesRulesQuery saleRebatesRulesQuery);

    /**
     * 查询租户下所有返费规则
     *
     * @param saleRebatesRulesQuery 查询条件
     * @return 返费规则
     */
    @ApiImplicitParams({
            @ApiImplicitParam(name = "saleRebatesRulesQuery", dataType = "SaleRebatesRulesQuery", value = "返费规则查询参数", paramType = "query")
    })
    @ApiOperation(value = "查询租户下所有返费规则")
    Result<List<SaleRebatesRulesDO>> selectSiteRebatesRules(SaleRebatesRulesQuery saleRebatesRulesQuery);

    /**
     * 查询规则绑定的用工单位及销售
     *
     * @param saleRebatesRulesQuery 查询参数
     * @return 规则绑定的用工单位及销售
     */
    @ApiOperation(value = "查询规则绑定的用工单位及销售")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "saleRebatesRulesQuery", dataType = "SaleRebatesRulesQuery", value = "查询参数", paramType = "query")
    })
    Result<Page<SaleRebatesRulesListVO>> selectBindCompany(SaleRebatesRulesQuery saleRebatesRulesQuery);

    /**
     * 查询对应用工单位下的返费规则
     *
     * @param companyId 用工单位Id
     * @return 返费规则
     */
    @ApiOperation(value = "查询对应用工单位下的返费规则")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "用工单位Id", paramType = "path")
    })
    Result<SaleRebatesRulesDO> selectRuleByCompany(String companyId);
}

